﻿// dllmain.cpp : 定义 DLL 应用程序的入口点。

#define _AFXDLL
#define _CRT_SECURE_NO_WARNINGS

#include "pch.h"
#include "dllmain.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <ctime>
#include <string.h>  
#include <windows.h>  
#include <string>
#include <tchar.h>
#include <atlstr.h>
#include <corecrt_io.h>
#include <io.h>
#include <vector>

#include <windows.h>  
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>

#include "IProc.h"
#include "Factory.h"
#include "Common.h"
#include "MuraJudgement.h"

using namespace std;

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}


//////////////////////////////////////////////////////////////////////

extern "C" __declspec(dllexport) int Visionox_DMA_Dll_Gen(char* path, double *R, double *G, double *B ,char *param)
{
	
	int ret;
	try
	{
		int buf[10];
		Get_Model_Info(buf);//获取ID
		Mura_Judegment(R, G, B);
		cout << "开始转档！" << endl;
		IFactory factor;
		IprocPtr pProcPtr = factor.GetProc(buf[0]);
		ret = pProcPtr->DemuraProcess(path, R, G, B, param);
		cout << "转档结束！" << endl;
		return ret;
	}
	catch (std::exception& e)
	{
		return -1;
	}
}

